package jp.co.hcs.attendancemanagement.inputdailyattendance.logic.dto;

import jp.co.hcs.attendancemanagement.util.StringUtil;

/**
 * The Class ProjectInfoDTO.
 */
public class ProjectInfoDTO {
  // project effort inf table
  /** The select. */
  private Boolean select;

  /** The seq no. */
  private String seqNo;

  /** The project number. */
  private String projectNumber;

  /** The project code. */
  private String projectCode;

  /** The seri. */
  private String seri;

  /** The project name. */
  private String projectName;

  /** The work code. */
  private String workCode;

  /** The work name. */
  private String workName;

  /** The working time. */
  private String workingTime;

  /** The comment. */
  private String comment;

  /** The employer code. */
  private String employerCode;

  /** The actual effort year month. */
  private String actualEffortYearMonth;

  /** The actual effort day. */
  private String actualEffortDay;

  /**
   * Gets the select.
   * 
   * @return the select
   */
  public Boolean getSelect() {
    return select;
  }

  /**
   * Sets the select.
   * 
   * @param select the new select
   */
  public void setSelect(Boolean select) {
    this.select = select;
  }

  /**
   * Gets the seq no.
   * 
   * @return the seq no
   */
  public String getSeqNo() {
    return seqNo;
  }

  /**
   * Sets the seq no.
   * 
   * @param seqNo the new seq no
   */
  public void setSeqNo(String seqNo) {
    this.seqNo = seqNo;
  }

  /**
   * Gets the project number.
   * 
   * @return the project number
   */
  public String getProjectNumber() {
    projectNumber = projectCode + seri;
    return projectNumber;
  }

  /**
   * Sets the project number.
   * 
   * @param projectNumber the new project number
   */
  public void setProjectNumber(String projectNumber) {
    this.projectNumber = projectNumber;
  }

  /**
   * Gets the project name.
   * 
   * @return the project name
   */
  public String getProjectName() {
    return projectName;
  }

  /**
   * Sets the project name.
   * 
   * @param projectName the new project name
   */
  public void setProjectName(String projectName) {
    this.projectName = projectName;
  }

  /**
   * Gets the project code.
   * 
   * @return the project code
   */
  public String getProjectCode() {
    return projectCode;
  }

  /**
   * Sets the project code.
   * 
   * @param projectCode the new project code
   */
  public void setProjectCode(String projectCode) {
    this.projectCode = projectCode;
  }

  /**
   * Gets the work code.
   * 
   * @return the work code
   */
  public String getWorkCode() {
    return workCode;
  }

  /**
   * Sets the work code.
   * 
   * @param workCode the new work code
   */
  public void setWorkCode(String workCode) {
    this.workCode = workCode;
  }

  /**
   * Gets the work name.
   * 
   * @return the work name
   */
  public String getWorkName() {
    return workName;
  }

  /**
   * Sets the work name.
   * 
   * @param workName the new work name
   */
  public void setWorkName(String workName) {
    this.workName = workName;
  }

  /**
   * Gets the working time.
   * 
   * @return the working time
   */
  public String getWorkingTime() {
    if (workingTime != null && workingTime.indexOf(":") == -1) {
      workingTime = StringUtil.convertStringTotalTimetoDisplayFormat(workingTime);
    }
    return workingTime;
  }

  /**
   * Sets the working time.
   * 
   * @param workingTime the new working time
   */
  public void setWorkingTime(String workingTime) {
    this.workingTime = workingTime;
  }

  /**
   * Gets the comment.
   * 
   * @return the comment
   */
  public String getComment() {
    return comment;
  }

  /**
   * Sets the comment.
   * 
   * @param comment the new comment
   */
  public void setComment(String comment) {
    this.comment = comment;
  }

  /**
   * Gets the seri.
   * 
   * @return the seri
   */
  public String getSeri() {
    if (!StringUtil.isEmpty(projectNumber)) {
      seri = projectNumber.substring(projectNumber.length() - 2, projectNumber.length());
    }
    return seri;
  }

  /**
   * Sets the seri.
   */
  public void setSeri(String seri) {
    this.seri = seri;
  }

  /**
   * Gets the employer code.
   * 
   * @return the employer code
   */
  public String getEmployerCode() {
    return employerCode;
  }

  /**
   * Sets the employer code.
   * 
   * @param employerCode the new employer code
   */
  public void setEmployerCode(String employerCode) {
    this.employerCode = employerCode;
  }

  /**
   * Gets the actual effort year month.
   * 
   * @return the actual effort year month
   */
  public String getActualEffortYearMonth() {
    return actualEffortYearMonth;
  }

  /**
   * Sets the actual effort year month.
   * 
   * @param actualEffortYearMonth the new actual effort year month
   */
  public void setActualEffortYearMonth(String actualEffortYearMonth) {
    this.actualEffortYearMonth = actualEffortYearMonth;
  }

  /**
   * Gets the actual effort day.
   * 
   * @return the actual effort day
   */
  public String getActualEffortDay() {
    return actualEffortDay;
  }

  /**
   * Sets the actual effort day.
   * 
   * @param actualEffortDay the new actual effort day
   */
  public void setActualEffortDay(String actualEffortDay) {
    this.actualEffortDay = actualEffortDay;
  }

  /*
   * (non-Javadoc)
   * 
   * @see java.lang.Object#equals(java.lang.Object)
   */
  public boolean equals(Object obj) {
    ProjectInfoDTO compareObj = (ProjectInfoDTO) obj;
    return projectCode.equals(compareObj.getProjectCode()) && seri.equals(compareObj.getSeri())
        && workCode.equals(compareObj.getWorkCode());
  }

}
